﻿<!doctype html>
<html>
<head>
    <title>SpreadJS - Compatible Sparkline</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    
    <link href="../../../external/spreadjs/css/gcspread.sheets.excel2013white.9.40.20161.0.css" rel="stylesheet" type="text/css" />

    <script src="../../../external/external/jquery-1.8.2.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../../external/spreadjs/gcspread.sheets.all.9.40.20161.0.min.js"></script>

    <script id="scriptInit" type="text/javascript">
        /*code_begin*/
        $(document).ready(function () {
            var spread = new GcSpread.Sheets.Spread(document.getElementById("ss"));
            initSpread(spread);
        });

        function initSpread(spread) {
            var spreadNS = GcSpread.Sheets;
            var sheet = spread.sheets[0];
            sheet.isPaintSuspended(true);

            sheet.addSpan(0, 0, 1, 5);
            sheet.getCell(0, 0).value("The company revenue in 2014").font("20px Arial").hAlign(spreadNS.HorizontalAlign.center).vAlign(spreadNS.VerticalAlign.center);
            var table1 = sheet.addTable("table1", 1, 0, 13, 5, spreadNS.TableStyles.medium4());
            table1.rowFilter().setShowFilterButton(false);
            sheet.setValue(1, 0, "Month");
            sheet.setValue(1, 1, "Revenue");
            sheet.setValue(1, 2, "Diagram 1");
            sheet.setValue(1, 3, "Diagram 2");
            sheet.setValue(1, 4, "Diagram 3");
            for (var i = 2; i < 14; i++) {
                sheet.setValue(i, 0, new Date(2014, i - 1, 1));
            }
            sheet.setFormatter(-1, 0, "mm/dd/yyyy");
            sheet.setValue(2, 1, 10);
            sheet.setValue(3, 1, 20);
            sheet.setValue(4, 1, 50);
            sheet.setValue(5, 1, 100);
            sheet.setValue(6, 1, 30);
            sheet.setValue(7, 1, - 10);
            sheet.setValue(8, 1, -25);
            sheet.setValue(9, 1, 60);
            sheet.setValue(10, 1, 50);
            sheet.setValue(11, 1, 30);
            sheet.setValue(12, 1, 80);
            sheet.setValue(13, 1, 88);
            sheet.addSpan(2, 2, 12, 1);
            sheet.setFormula(2, 2, '=LINESPARKLINE(B3:B14,0,A3:A14,0,"{axisColor:rgb(255,255,0),firstMarkerColor:brown,highMarkerColor:red,lastMarkerColor:blue,lowMarkerColor:green,markersColor:purple,negativeColor:yellowgreen,seriesColor:pink,displayXAxis:true,showFirst:true,showHigh:true,showLast:true,showLow:true,showNegative:true,showMarkers:true,lineWeight:3,displayHidden:false,displayEmptyCellsAs:1,rightToLeft:false,minAxisType:1,maxAxisType:1,manualMax:5,manualMin:-3}")');
            sheet.addSpan(2, 3, 12, 1);
            sheet.setFormula(2, 3, '=COLUMNSPARKLINE(B3:B14,0,A3:A14,0,"{axisColor:rgb(255,255,0),firstMarkerColor:brown,highMarkerColor:red,lastMarkerColor:blue,lowMarkerColor:green,markersColor:purple,negativeColor:yellowgreen,seriesColor:pink,displayXAxis:true,showFirst:true,showHigh:true,showLast:true,showLow:true,showNegative:true,showMarkers:true,lineWeight:3,displayHidden:false,displayEmptyCellsAs:1,rightToLeft:false,minAxisType:1,maxAxisType:1,manualMax:5,manualMin:-3}")');
            sheet.addSpan(2, 4, 12, 1);
            sheet.setFormula(2, 4, '=WINLOSSSPARKLINE(B3:B14,0,A3:A14,0)');
            sheet.setRowHeight(0, 50);
            for (var i = 1; i < 14; i++) {
                sheet.setRowHeight(i, 15);
            }
            sheet.setColumnWidth(0, 80);
            sheet.setColumnWidth(2, 200);
            sheet.setColumnWidth(3, 200);
            sheet.setColumnWidth(4, 200);

            sheet.isPaintSuspended(false);
        };

        /*code_end*/
    </script>

</head>
<body>
<div class="sample-turtorial">
    <div id="ss" style="width:100%; height:420px;border: 1px solid gray;"></div>
</div>
</body>
</html>
